//
//  SortTableViewCell.m
//  MountEverestFM
//
//  Created by ChenNing on 15/10/28.
//  Copyright © 2015年 chenn. All rights reserved.
//

#import "SortTableViewCell.h"
#import "SortModel.h"

@implementation SortTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        self.button1=[UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:self.button1];
        
        self.button2=[UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:self.button2];

        self.button3=[UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:self.button3];

        self.button4=[UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:self.button4];

        self.button5=[UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:self.button5];

        self.imageV1=[[UIImageView alloc]init];
        [self.button1 addSubview:self.imageV1];
        self.imageV2=[[UIImageView alloc]init];
        [self.button2 addSubview:self.imageV2];
        self.imageV3=[[UIImageView alloc]init];
        [self.button3 addSubview:self.imageV3];
        self.imageV4=[[UIImageView alloc]init];
        [self.button4 addSubview:self.imageV4];
        self.imageV5=[[UIImageView alloc]init];
        [self.button5 addSubview:self.imageV5];
        
        
        self.lable1=[[UILabel alloc]init];
        [self.button1 addSubview:self.lable1];
        self.lable2=[[UILabel alloc]init];
        [self.button2 addSubview:self.lable2];
        self.lable3=[[UILabel alloc]init];
        [self.button3 addSubview:self.lable3];
        self.lable4=[[UILabel alloc]init];
        [self.button4 addSubview:self.lable4];
        self.lable5=[[UILabel alloc]init];
        [self.button5 addSubview:self.lable5];
        
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.button1.frame=CGRectMake(FM_Screen_Pts_Width*10, FM_Screen_Pts_Height*10, FM_Screen_Width/2-FM_Screen_Pts_Width *10, self.contentView.bounds.size.height-FM_Screen_Pts_Width*20);
    self.imageV1.frame=self.button1.bounds;
    
    self.button2.frame=CGRectMake(FM_Screen_Width/2+FM_Screen_Pts_Width *10, FM_Screen_Pts_Height*10, FM_Screen_Width/2/2-FM_Screen_Pts_Width *10-FM_Screen_Pts_Width *5, self.contentView.bounds.size.height/2-FM_Screen_Pts_Width*15);
    
    self.imageV2.frame=self.button2.bounds;
    
    self.button3.frame=CGRectMake(FM_Screen_Width/4*3+FM_Screen_Pts_Width *10-FM_Screen_Pts_Width *5, FM_Screen_Pts_Height*10,  FM_Screen_Width/2/2-FM_Screen_Pts_Width *10-FM_Screen_Pts_Width *5, self.contentView.bounds.size.height/2-FM_Screen_Pts_Width*15);
    self.imageV3.frame=self.button3.bounds;
    
    
    self.button4.frame=CGRectMake(FM_Screen_Width/2+FM_Screen_Pts_Width *10,self.contentView.bounds.size.height/2+ FM_Screen_Pts_Height*5, FM_Screen_Width/2/2-FM_Screen_Pts_Width *10-5, self.contentView.bounds.size.height/2-FM_Screen_Pts_Width*15);
    
    self.imageV4.frame=self.button4.bounds;
    
    
    self.button5.frame=CGRectMake(FM_Screen_Width/4*3+FM_Screen_Pts_Width *10-FM_Screen_Pts_Width *5, self.contentView.bounds.size.height/2+FM_Screen_Pts_Height*5,  FM_Screen_Width/2/2-FM_Screen_Pts_Width *10-FM_Screen_Pts_Width *5, self.contentView.bounds.size.height/2-FM_Screen_Pts_Width*15);
    self.imageV5.frame=self.button5.bounds;

    
}


- (void)awakeFromNib {
    // Initialization code
}

-(void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    if (selected) {
        self.backgroundColor = Cell_Selected_Color;
    }else{
        self.backgroundColor = [UIColor whiteColor];
    }
}
@end
